/*
 * @Author: yangrongxin
 * @Date: 2021-06-07 16:48:31
 * @LastEditors: yangrongxin
 * @LastEditTime: 2021-09-17 09:41:25
 */
import Taro from '@tarojs/taro';
import { View, Text, Image } from '@tarojs/components';
import styles from './index.module.less';

const ArticleItem = ({
  articleId,
  title,
  subhead,
  // content, // 文章中的内容 点击之后存到store中 用于新页面进行展示
  cover = 'https://hxgywx.oss-cn-shenzhen.aliyuncs.com/nursing-customer/assets/articleVideoCover.png',
  readCount,
  extendWapperClass,
  isHomeScroll,
}) => {
  return (
    <View
      className={`${styles.articleItem} ${extendWapperClass}`}
      onClick={() => {
        Taro.navigateTo({
          url: `/pages/PatientEducation/components/ArticleContent/index?articleId=${articleId}`,
        });
      }}
    >
      <View>
        <Text className={`ellipsisText ${styles.homeScrollText}`}>{title}</Text>
        <Text className={`ellipsisText ${styles.homeScrollText}`}>{subhead}</Text>
        <View>
          <Text>{readCount}浏览</Text>
        </View>
      </View>
      <Image src={cover} mode="aspectFill" />
    </View>
  );
};

export default ArticleItem;
